/**
 * 
 */

app = function(){
	
	/*
	 * Private functions
	 */
	function createCentre(){
		return new app.widgets.TabPanel({
			region: 'center',
			id : 'center', 
			xtype: 'apptabpanel', 
			home: {
				xtype: 'taskwall', 
				id: 'taskwall', 
				title: 'Task Wall'
			}
		}); 
	}
	
	return {
		
		init: function(){
			
			Ext.Direct.addProvider( Ext.app.EXTDIRECT_API );
			Ext.QuickTips.init();
			
			Ext.util.Observable.observeClass(Ext.data.Store);
			Ext.data.Store.on('exception', function () {
        		if(Ext.isGecko3) 
        			console.info(arguments);
        	});
			
			var centerPanel = createCentre();
			
			var timeTracker = new app.widgets.TimeTracker({
				items: [ centerPanel, {
					region: 'west', 
					xtype: 'projecttree', 
					id: 'projecttree', 
					title: 'Project Tree'
				}]
			});
			
			centerPanel.add({xtype : 'timesheet',title : 'Time Sheet'}); 
			
			app.Utils.checkStartedTasks(); 
			
		}
	
		/*
		 * Getters: 
		 */
	
		, getTaskWall : function(){
			
			return Ext.getCmp('taskwall'); 
			
		}
		
		, getCenterPanel : function(){
			
			return Ext.getCmp('center');
			
		}
	
		
	}
}(); 
